import DS from 'ember-data';
import BaseModel from './base-model';

var Bed = BaseModel.extend({
  buttonID:DS.attr('string'),//小米按键ID
  name:DS.attr('string'),//床位名称
  price:DS.attr('string'),//价格
  status:DS.belongsTo('dicttype'),//状态  已分配、未分配
  createDateTime:DS.attr('number'),//创建时间
  lastUpdateDateTime:DS.attr('number'),//更新时间
  room:DS.belongsTo('room'),//所属房屋
  bedType:DS.belongsTo('dicttypetenant'),//床位类型
  lastUpdateUser:DS.belongsTo('user'),//更新操作者userid
  nursingType:DS.belongsTo('dicttype'),//护理类型
  createUser:DS.belongsTo('user'),//创建者ID
  roomBedName:Ember.computed("room","name",function(){
    var roomName=this.get("room.name");
    var bedName=this.get("name");
    return roomName+"-"+bedName;
  }),
  roomName:Ember.computed("roomBedName",function(){
    var roomBedName=this.get("roomBedName");
    return roomBedName.split("-").join("");
  }),
});

export default Bed;
